
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.internal.backends.chrome_inspector.inspector_websocket</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.backends.html"><font color="#ffffff">backends</font></a>.<a href="telemetry.internal.backends.chrome_inspector.html"><font color="#ffffff">chrome_inspector</font></a>.inspector_websocket</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/backends/chrome_inspector/inspector_websocket.py">telemetry/internal/backends/chrome_inspector/inspector_websocket.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="errno.html">errno</a><br>
<a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br>
</td><td width="25%" valign=top><a href="json.html">json</a><br>
<a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="socket.html">socket</a><br>
<a href="time.html">time</a><br>
</td><td width="25%" valign=top><a href="telemetry.internal.backends.chrome_inspector.websocket.html">telemetry.internal.backends.chrome_inspector.websocket</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.internal.backends.chrome_inspector.inspector_websocket.html#InspectorWebsocket">InspectorWebsocket</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.internal.backends.chrome_inspector.inspector_websocket.html#WebSocketDisconnected">WebSocketDisconnected</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="InspectorWebsocket">class <strong>InspectorWebsocket</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="InspectorWebsocket-AsyncRequest"><strong>AsyncRequest</strong></a>(self, req, callback)</dt><dd><tt>Sends&nbsp;an&nbsp;async&nbsp;request&nbsp;and&nbsp;returns&nbsp;immediately.<br>
&nbsp;<br>
Response&nbsp;will&nbsp;be&nbsp;handled&nbsp;in&nbsp;the&nbsp;|callback|&nbsp;later&nbsp;when&nbsp;DispatchNotifications<br>
is&nbsp;invoked.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;callback:&nbsp;a&nbsp;function&nbsp;that&nbsp;takes&nbsp;inspector's&nbsp;response&nbsp;as&nbsp;the&nbsp;argument.</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-Connect"><strong>Connect</strong></a>(self, url, timeout<font color="#909090">=10</font>)</dt><dd><tt>Connects&nbsp;the&nbsp;websocket.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;websocket.WebSocketException<br>
&nbsp;&nbsp;socket.error</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-Disconnect"><strong>Disconnect</strong></a>(self)</dt><dd><tt>Disconnects&nbsp;the&nbsp;inspector&nbsp;websocket.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;websocket.WebSocketException<br>
&nbsp;&nbsp;socket.error</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-DispatchNotifications"><strong>DispatchNotifications</strong></a>(self, timeout<font color="#909090">=10</font>)</dt><dd><tt>Waits&nbsp;for&nbsp;responses&nbsp;from&nbsp;the&nbsp;websocket,&nbsp;dispatching&nbsp;them&nbsp;as&nbsp;necessary.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;websocket.WebSocketException:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
&nbsp;&nbsp;socket.error:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
&nbsp;&nbsp;exceptions.<a href="#WebSocketDisconnected">WebSocketDisconnected</a>:&nbsp;The&nbsp;socket&nbsp;was&nbsp;disconnected.</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-RegisterDomain"><strong>RegisterDomain</strong></a>(self, domain_name, notification_handler)</dt><dd><tt>Registers&nbsp;a&nbsp;given&nbsp;domain&nbsp;for&nbsp;handling&nbsp;notification&nbsp;methods.<br>
&nbsp;<br>
For&nbsp;example,&nbsp;given&nbsp;inspector_backend:<br>
&nbsp;&nbsp;&nbsp;def&nbsp;OnConsoleNotification(msg):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;msg['method']&nbsp;==&nbsp;'Console.messageAdded':<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;msg['params']['message']<br>
&nbsp;&nbsp;&nbsp;inspector_backend.<a href="#InspectorWebsocket-RegisterDomain">RegisterDomain</a>('Console',&nbsp;OnConsoleNotification)<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;domain_name:&nbsp;The&nbsp;devtools&nbsp;domain&nbsp;name.&nbsp;E.g.,&nbsp;'Tracing',&nbsp;'Memory',&nbsp;'Page'.<br>
&nbsp;&nbsp;notification_handler:&nbsp;Handler&nbsp;for&nbsp;devtools&nbsp;notification.&nbsp;Will&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;called&nbsp;if&nbsp;a&nbsp;devtools&nbsp;notification&nbsp;with&nbsp;matching&nbsp;domain&nbsp;is&nbsp;received<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via&nbsp;DispatchNotifications.&nbsp;The&nbsp;handler&nbsp;accepts&nbsp;a&nbsp;single&nbsp;paramater:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;JSON&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;representing&nbsp;the&nbsp;notification.</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-SendAndIgnoreResponse"><strong>SendAndIgnoreResponse</strong></a>(self, req)</dt><dd><tt>Sends&nbsp;a&nbsp;request&nbsp;without&nbsp;waiting&nbsp;for&nbsp;a&nbsp;response.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;websocket.WebSocketException:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
&nbsp;&nbsp;socket.error:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
&nbsp;&nbsp;exceptions.<a href="#WebSocketDisconnected">WebSocketDisconnected</a>:&nbsp;The&nbsp;socket&nbsp;was&nbsp;disconnected.</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-SyncRequest"><strong>SyncRequest</strong></a>(self, req, timeout<font color="#909090">=10</font>)</dt><dd><tt>Sends&nbsp;a&nbsp;request&nbsp;and&nbsp;waits&nbsp;for&nbsp;a&nbsp;response.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;websocket.WebSocketException:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
&nbsp;&nbsp;socket.error:&nbsp;<a href="telemetry.core.exceptions.html#Error">Error</a>&nbsp;from&nbsp;websocket&nbsp;library.<br>
&nbsp;&nbsp;exceptions.<a href="#WebSocketDisconnected">WebSocketDisconnected</a>:&nbsp;The&nbsp;socket&nbsp;was&nbsp;disconnected.</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-UnregisterDomain"><strong>UnregisterDomain</strong></a>(self, domain_name)</dt><dd><tt>Unregisters&nbsp;a&nbsp;previously&nbsp;registered&nbsp;domain.</tt></dd></dl>

<dl><dt><a name="InspectorWebsocket-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Create&nbsp;a&nbsp;websocket&nbsp;handler&nbsp;for&nbsp;communicating&nbsp;with&nbsp;Inspectors.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>METHOD_NOT_FOUND_CODE</strong> = -32601</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="WebSocketDisconnected">class <strong>WebSocketDisconnected</strong></a>(<a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>An&nbsp;attempt&nbsp;was&nbsp;made&nbsp;to&nbsp;use&nbsp;a&nbsp;web&nbsp;socket&nbsp;after&nbsp;it&nbsp;had&nbsp;been&nbsp;disconnected.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.internal.backends.chrome_inspector.inspector_websocket.html#WebSocketDisconnected">WebSocketDisconnected</a></dd>
<dd><a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods inherited from <a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>:<br>
<dl><dt><a name="WebSocketDisconnected-AddDebuggingMessage"><strong>AddDebuggingMessage</strong></a>(self, msg)</dt><dd><tt>Adds&nbsp;a&nbsp;message&nbsp;to&nbsp;the&nbsp;description&nbsp;of&nbsp;the&nbsp;exception.<br>
&nbsp;<br>
Many&nbsp;Telemetry&nbsp;exceptions&nbsp;arise&nbsp;from&nbsp;failures&nbsp;in&nbsp;another&nbsp;application.&nbsp;These<br>
failures&nbsp;are&nbsp;difficult&nbsp;to&nbsp;pinpoint.&nbsp;This&nbsp;method&nbsp;allows&nbsp;Telemetry&nbsp;classes&nbsp;to<br>
append&nbsp;useful&nbsp;debugging&nbsp;information&nbsp;to&nbsp;the&nbsp;exception.&nbsp;This&nbsp;method&nbsp;also&nbsp;logs<br>
information&nbsp;about&nbsp;the&nbsp;location&nbsp;from&nbsp;where&nbsp;it&nbsp;was&nbsp;called.</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__init__"><strong>__init__</strong></a>(self, msg<font color="#909090">=''</font>)</dt></dl>

<dl><dt><a name="WebSocketDisconnected-__str__"><strong>__str__</strong></a>(self)</dt></dl>

<hr>
Data descriptors inherited from <a href="telemetry.core.exceptions.html#Error">telemetry.core.exceptions.Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#WebSocketDisconnected-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="WebSocketDisconnected-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="WebSocketDisconnected-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#WebSocketDisconnected-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="WebSocketDisconnected-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="WebSocketDisconnected-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>

<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table></td></tr></table>
</body></html>